<?php
use PsiFramework\Classes\Util\UI\Printer;
use PsiFramework\Classes\Util\UI\HTML;

$user = $response->getAttribute('user');

$conversationId = $response->getAttribute('conversationId');
$recipientId = $response->getAttribute('recipientId');

$recipientEmail = $response->getAttribute('recipientEmail');

$recipientField = 'recipient_id';
$recipient = $recipientId;
if (!isNullOrEmptyString($recipientEmail)) {
    $recipientField = 'recipient_email';
    $recipient = $recipientEmail;
}

?>
<form action="<?php echo HTML::linkHref('action=SendMessage')?>" method="POST">
    <input type="hidden" name="<?php Printer::display($recipientField); ?>" value="<?php Printer::display($recipient); ?>" />
    <input type="hidden" name="conversation_id" value="<?php Printer::display($conversationId); ?>" />
    <fieldset>
        <label for="message_title">Titre</label>
        <input type="text" id="message_title" name="message_title" value="" />
    </fieldset>
    <fieldset>
        <label for="message_content">Message</label>
        <textarea id="message_content" name="message_content"></textarea>
    </fieldset>
    <input type="submit" />
</form>